package com.prp.service;

import com.prp.interfaces.*;

public class ServiceFactory {

	 public static final int FILESERVER = 1;
	 private static IFileManage fileManage = null;
	 private static IUserManage userManage= null;
	 private static IFileUploadServ fileUpload= null;
	 private static IAdminSystem adminFunc= null;
	 private static IUserAuthoritySys userAuthoritySys = null;
	 private static ISearchServ searchServce = null;
	 
	 private ServiceFactory(){
		 
	 }
	 public static ISearchServ getSearchServce(){
		 if (searchServce == null){
			 searchServce = new SearchServImpl();
		 }
		 return searchServce;
	 }
	 
	 public static IAdminSystem getAdminSystemSer()
	 {
		 if (adminFunc == null)
		 {
			 adminFunc = new AdminFunctionImpl();
			 return adminFunc;
		 }
		 else
		 {
			 return adminFunc;
		 }
	 }
	 public static IFileUploadServ getFileUploadService()
	 {
		 if (fileUpload == null)
		 {
			 fileUpload = new FileUploadImpl();
			 return fileUpload;
		 }
		 else
		 {
			 return fileUpload;
		 }
	 }
	 public static IFileManage getFileManage()
	 {
		 if (fileManage == null)
		 {
			 fileManage = new FileManageImpl();
			 return fileManage;
		 }
		 else
		 {
			 return fileManage;
		 }
	 }
	
	 
	 public static IUserManage getUserManage()
	 {
		 if (userManage == null)
		 {
			 userManage = new UserManage();
			 return userManage;
		 }
		 else
		 {
			 return userManage;
		 }
		 
	 }
	 
	 public static IUserAuthoritySys getUserAuthoritySys()
	 {
		 if	(userAuthoritySys == null)
		 {
			 userAuthoritySys = new UserAuthoritySys();
			 return userAuthoritySys;
		 }
		 else
		 {
			 return userAuthoritySys;
		 }
	 }
}
